package com.headingdata.demo;

public class Test2 {
    public static void main(String[] args) {
        //数组位置交换
        int[] nums = {10,20,30,40,50,60};
        for (int i = 0,j = nums.length-1;i<j;i++,j--){
            int temp = nums[j];
            nums[j] = nums[i];
            nums[i] = temp;
        }
        for (int num : nums) {
            System.out.print(num + " ");
        }
    }
}
